UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hi0b35eGPUCUEmd0WPfUdwLHEugOodHvsf2MU38zuy0=' 
WHERE 
  key_id = '93a5e81a79355695d8f3f094f514bf22b148fbc9ab52762d5bc9cb78861b8225' 
  AND (
    token = 'Hi0b35eGPUCUEmd0WPfUdwLHEugOodHvsf2MU38zuy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037