UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fhlVEX+AYfQ+kADUxOuwKBVqTxxj7Dzy/V5ibj3Ee24=' 
WHERE 
  key_id = '37f5bcc21eabc2f48fbd5237d7db173871ae32202b45117cc0199ec318fc5fa3' 
  AND (
    token = 'fhlVEX+AYfQ+kADUxOuwKBVqTxxj7Dzy/V5ibj3Ee24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050