UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KAbyEPBICVag5T7yrGXjyLyfq6dr8nJXyd5/5e3bLHw=' 
WHERE 
  key_id = '0593c7be7807ab3633bb91d3e5e7fff9bdd2d183d19745d0c6ad531d8c260592' 
  AND (
    token = 'KAbyEPBICVag5T7yrGXjyLyfq6dr8nJXyd5/5e3bLHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032