UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XP0wQp+gd9c2/FdrM2LNKFYfWnG1BGtezF0VZgy67Fw=' 
WHERE 
  key_id = '7db411ec867eac674692f9cc3fd15a04b7bed14f4f95569e35f419bd4b2689e1' 
  AND (
    token = 'XP0wQp+gd9c2/FdrM2LNKFYfWnG1BGtezF0VZgy67Fw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021