UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SY2EZQXVOmFlPeuuls3lVQ5ITje3xIdTKQiDDEcZkZc=' 
WHERE 
  key_id = 'e321d24d4d6c080fc1ae832699552db3ab4cffb1bb3a93f9c7bd5461fa87751d' 
  AND (
    token = 'SY2EZQXVOmFlPeuuls3lVQ5ITje3xIdTKQiDDEcZkZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027