UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Ae1tJ1YUdipTWud3nFC9COeoPOKHe5ZbEcpyGFc/nY=' 
WHERE 
  key_id = '741cc71792d9cd8587f4056128043855b0101232fab35a6d183cdcf561e6fa23' 
  AND (
    token = '8Ae1tJ1YUdipTWud3nFC9COeoPOKHe5ZbEcpyGFc/nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025