UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X07Vwp8UtQ6JnfrhUgk7rnMAvJcSITbTREPMx14JXT0=' 
WHERE 
  key_id = '086a8e0425090cc611b4c8bf905bcde13a2ba65632aac30f0962a99f92342eef' 
  AND (
    token = 'X07Vwp8UtQ6JnfrhUgk7rnMAvJcSITbTREPMx14JXT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033