UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G0NB9g/OSwomQlNkF2wKOKMArXlcs4bMm5Oojua6yaA=' 
WHERE 
  key_id = '16e8a92bf6e9e82ff52d0b997a793826fbc4ccc1798e6f6efdedbd76f7f4ab71' 
  AND (
    token = 'G0NB9g/OSwomQlNkF2wKOKMArXlcs4bMm5Oojua6yaA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027