UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '48LrSTC817hpSkW2xpXPbN8MuiWmWLST/cA9xkn7zgg=' 
WHERE 
  key_id = '8e1dfa04ee9083046b0d9d37bdf9da3b7d8f27705859ff704717a61c842530be' 
  AND (
    token = '48LrSTC817hpSkW2xpXPbN8MuiWmWLST/cA9xkn7zgg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033