UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZhP9lvH4IWjH9XXoO9r9wzirGxefvT3Y7QJxVKw8JcM=' 
WHERE 
  key_id = '1fcc2d9cf8bddfadbb01140a9d13c587e45b5582bf98bf87f507d35f1607acbc' 
  AND (
    token = 'ZhP9lvH4IWjH9XXoO9r9wzirGxefvT3Y7QJxVKw8JcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051