UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jHgucNzfl1P+QsX7EZ8qc8IYejvAGmW9qgb1IO/jCZc=' 
WHERE 
  key_id = '9de32aa1f3ec6e68cb6c1246c965c14b300feda46c6bb1deb8735824839ded3a' 
  AND (
    token = 'jHgucNzfl1P+QsX7EZ8qc8IYejvAGmW9qgb1IO/jCZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035