UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1lhCmkwvjycyXOroQtgZMK+FQs48XcLxWmG09ayN18A=' 
WHERE 
  key_id = '28f9e6e5281cd19aa7456bcfbdf75d60bb631125af86e075853be66c4a8dc721' 
  AND (
    token = '1lhCmkwvjycyXOroQtgZMK+FQs48XcLxWmG09ayN18A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020