UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z04YkuJ7ODZ37hxQ9PV4tR2kpbb5ZxqIXMWvT+3hjq4=' 
WHERE 
  key_id = 'c571cb69a1fea2504171949eb39104c915b7fea9c2c70db47efe1fd5951f47c1' 
  AND (
    token = 'z04YkuJ7ODZ37hxQ9PV4tR2kpbb5ZxqIXMWvT+3hjq4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021