UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7xeAvNI84j9AkFlnNWnt7qp/zSWgllGModW/1Hskb/g=' 
WHERE 
  key_id = 'd9c01f347d7ea6e79ee63180d2b99af82cbef45908f041e19917ec4011801f3d' 
  AND (
    token = '7xeAvNI84j9AkFlnNWnt7qp/zSWgllGModW/1Hskb/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021