UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mgp16OjSbMPLkoLVeUXYfFb1rtjK+Y2MrSlJoNhofXI=' 
WHERE 
  key_id = '08a2fa25989f92965ec56bf913bbd54d46451e5348f2efad4bb72b69a8b69dad' 
  AND (
    token = 'Mgp16OjSbMPLkoLVeUXYfFb1rtjK+Y2MrSlJoNhofXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030