UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ozNpvj4kgtuoI1zZZGzk0c8I68YiiBxeUrk4vgfK9uU=' 
WHERE 
  key_id = '4db009bcf15a9932de63aa295616171c91308a9ddec0ddfca05738b39a209f86' 
  AND (
    token = 'ozNpvj4kgtuoI1zZZGzk0c8I68YiiBxeUrk4vgfK9uU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027