UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SwhDLjNXJ+KOrC+1K7OkDMzIBPPc7ekpAWdfzM32VTM=' 
WHERE 
  key_id = '52ff69b9f6b7319aa13e55260527acc7921eebaf4e3bdf0e08cdccfc8144ac97' 
  AND (
    token = 'SwhDLjNXJ+KOrC+1K7OkDMzIBPPc7ekpAWdfzM32VTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051