UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YlRIVPLhEcw3weNRdtqzzTUe5S1Z9aJu0x1f1wNRghA=' 
WHERE 
  key_id = 'fb2c539b9d573d9d69de9fed585b149521a5d0790ba658ae2252811af174077c' 
  AND (
    token = 'YlRIVPLhEcw3weNRdtqzzTUe5S1Z9aJu0x1f1wNRghA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024