UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hC/15VZsRxClMxdrk1Y+GNMyY3TVMAsUN4DMW4hz0XQ=' 
WHERE 
  key_id = 'f45d81c36a9a812441bf11fbf9bf4624f904f59d24e8d232c6d34320806a7ea0' 
  AND (
    token = 'hC/15VZsRxClMxdrk1Y+GNMyY3TVMAsUN4DMW4hz0XQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022