UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wJJjwOswkn6Y/fadFwXzoliTq5C21AUTRM3+Drf9eKU=' 
WHERE 
  key_id = '63cc00cc5b802218891456a3b897368887339b820337dcbf6848b8e0f2e80211' 
  AND (
    token = 'wJJjwOswkn6Y/fadFwXzoliTq5C21AUTRM3+Drf9eKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029