UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YOm0vNzQGIqaB2cRwMs+P6nuyfLKcAFlrQgZwNd0hzU=' 
WHERE 
  key_id = '115ea8604c5636e13675a8e6aee8dc3194dc8aafde2eb71acbea3c31356d2f3a' 
  AND (
    token = 'YOm0vNzQGIqaB2cRwMs+P6nuyfLKcAFlrQgZwNd0hzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049