UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uMUrMzaDP6DVT7nruiWQMF9yAVzpOfmy82A5N1qg/QY=' 
WHERE 
  key_id = 'd7b93b201383dece1fb27520d8d1559e3915269eebdd4de9327fa1080e2d143d' 
  AND (
    token = 'uMUrMzaDP6DVT7nruiWQMF9yAVzpOfmy82A5N1qg/QY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029