UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QsvPzMTEsmV/eyXRQzFz9eUWl517Jv8gKLc6m6Bs24o=' 
WHERE 
  key_id = '9f6805f2da9edf26e68f4427d834f77c8989c527be6070753d6e0e8022453621' 
  AND (
    token = 'QsvPzMTEsmV/eyXRQzFz9eUWl517Jv8gKLc6m6Bs24o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023