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

Query time 0.00029