UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EUT954YF24JO1CPjrMiFyvGAsAZ21g/QWF0Juj01Ado=' 
WHERE 
  key_id = '2cdf53a98a903479df0c98191439d858e24c0ddb7c109d98317dcfda9ae08119' 
  AND (
    token = 'EUT954YF24JO1CPjrMiFyvGAsAZ21g/QWF0Juj01Ado=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015