UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '63gPnL8oKH4YMNP3K0+bEwqvLHqQJw+HZnRVWRnMGKg=' 
WHERE 
  key_id = '979612b80226d4bb4600c2b5a8e8667b33bb4ec5c986570bfd8f47701ca041ae' 
  AND (
    token = '63gPnL8oKH4YMNP3K0+bEwqvLHqQJw+HZnRVWRnMGKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040