UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/nnkNqzvUM37aRBsVKp+oT5jnXH60nqRhzIy037oUDE=' 
WHERE 
  key_id = '7de1ff801177c1c4adde1a19c387c7a9f04f9179492f20405116fa9fe355a193' 
  AND (
    token = '/nnkNqzvUM37aRBsVKp+oT5jnXH60nqRhzIy037oUDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048