UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yv9UtXJ6EROPjCycbaqBnBMawdXZgZXBwg0dNIbRLzU=' 
WHERE 
  key_id = '0679fcc9e050b8a4bedfffd543e29b99c3f5442afaaa3d5f9db25ae12aa54c12' 
  AND (
    token = 'yv9UtXJ6EROPjCycbaqBnBMawdXZgZXBwg0dNIbRLzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035