UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pAv9+Xck9VWmCthz925QWAQF4ZUwjT/4ECZu+tgWjl4=' 
WHERE 
  key_id = 'f0eafe1ba901bf16743ae8c2c7b85f3a845e74903f810a4f7af972cbb41731ab' 
  AND (
    token = 'pAv9+Xck9VWmCthz925QWAQF4ZUwjT/4ECZu+tgWjl4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030