UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PvZ2cWn26Pau8ppP3eBrfb0KInEM+8TNYuG9Xf2J5ao=' 
WHERE 
  key_id = '9158867cfc662e1f676ce2e7c115850ffa893afc3f73176b50d7f68b3667b2e0' 
  AND (
    token = 'PvZ2cWn26Pau8ppP3eBrfb0KInEM+8TNYuG9Xf2J5ao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030