UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vWCBV/Tfsdw4qyO2NIRCCFifmkAyvvjaThAdisJgL9U=' 
WHERE 
  key_id = '8a6aa596d128710e2f4bfe68194a7c5026f0e1ba40e3e2b00fa8112fed0e0252' 
  AND (
    token = 'vWCBV/Tfsdw4qyO2NIRCCFifmkAyvvjaThAdisJgL9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021