UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vujk0aS9WFWNW2VLdEfKMbWYiHhnb/IXuZSy2ml/3Ag=' 
WHERE 
  key_id = '58d35a56adc3d8a33e1a26c215b1c3c9a4644f93e40e3f8b3dd6033790abe4ff' 
  AND (
    token = 'Vujk0aS9WFWNW2VLdEfKMbWYiHhnb/IXuZSy2ml/3Ag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025