UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SUSfe42ZRglRuI7sbdMd9nJb/6NYf7Vk4siKMZjgkeo=' 
WHERE 
  key_id = 'b12ef525b7396a6c8c9c35799c4030650b4dfa1a6a2e726710f42f4bc5b2bd80' 
  AND (
    token = 'SUSfe42ZRglRuI7sbdMd9nJb/6NYf7Vk4siKMZjgkeo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031