UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lXt8uZbJGmk6Swx5lUY4D0r07M0gbvcbbg8a2krKMEQ=' 
WHERE 
  key_id = '73b4ffa3012b9181d9b76f78b5cef2911d7d142875d7e8c992aade447f358c16' 
  AND (
    token = 'lXt8uZbJGmk6Swx5lUY4D0r07M0gbvcbbg8a2krKMEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062