UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B0aNplWQxcz7O5A6BI4VgnGsdr1aZpWAhAwsZG+XrmQ=' 
WHERE 
  key_id = '8120f7b5f8969ed7e9fc872d5369c8bae0cd234ca57c95775af412ca73edfcbe' 
  AND (
    token = 'B0aNplWQxcz7O5A6BI4VgnGsdr1aZpWAhAwsZG+XrmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036