UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VXrTW3H7zyNMDguUKWXL6ZHtzZqNB/VZrHOIfu3+CrM=' 
WHERE 
  key_id = '7a16beb685474986600c7b5bcb7f5c41e74793be874b1b88b1e159d0dca69acd' 
  AND (
    token = 'VXrTW3H7zyNMDguUKWXL6ZHtzZqNB/VZrHOIfu3+CrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027