UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UZnCF0NDkXXP77IR0Z3xjES/l5EbENx8JHvlPd1IUt4=' 
WHERE 
  key_id = '5acf5bd7b41290d76ef9433e6c41e87a61ebbee8471a9d8ea25c0c5cff0d36eb' 
  AND (
    token = 'UZnCF0NDkXXP77IR0Z3xjES/l5EbENx8JHvlPd1IUt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029