UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QCPzl6Xb74owKkvAALVBqXYtdLndfWnvh6TrBg0CBNE=' 
WHERE 
  key_id = '9eacb61b451bcf5ed980624630b1a4462f0882527b6bc6c54db1375c4af6d7d9' 
  AND (
    token = 'QCPzl6Xb74owKkvAALVBqXYtdLndfWnvh6TrBg0CBNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033