UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hHpWB+X5cUTywPWpaRKcIZcS3JwvaBh4y3CPU2YQBWY=' 
WHERE 
  key_id = '6617abcb2c0db87e1b7f15ef9e4c5c242b6e89652bfbccae90c762a8839b31a9' 
  AND (
    token = 'hHpWB+X5cUTywPWpaRKcIZcS3JwvaBh4y3CPU2YQBWY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036