UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GdXk7EEG8i9AAIW74t+RazEqXl5RzFt0VUlXpAv1R5M=' 
WHERE 
  key_id = '1973462cbf1fd50a42fd7446917d1a526a38c300af6b6930a2b0992ac5aaed3c' 
  AND (
    token = 'GdXk7EEG8i9AAIW74t+RazEqXl5RzFt0VUlXpAv1R5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037