UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '81pmQTE2oNx/toCgCMhk5BxhB3HJ9iqYZsKREjmWMZQ=' 
WHERE 
  key_id = '00888487c97e43117b9d3cccc585ef7a251a9265b45da6d4aa2944637e7645b6' 
  AND (
    token = '81pmQTE2oNx/toCgCMhk5BxhB3HJ9iqYZsKREjmWMZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034