UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qcgr9dNigDq81TnYTG6mOF7GTikLNa1IKYNvk0lp1XQ=' 
WHERE 
  key_id = '4b58d8c81431bf5297755cd9a49b6a530391692fd2bee302439941d5e8ec77dc' 
  AND (
    token = 'Qcgr9dNigDq81TnYTG6mOF7GTikLNa1IKYNvk0lp1XQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021