UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jqGheIZF3/CP9vloMyhq28jQUFhY6TL55LXTqthUpw8=' 
WHERE 
  key_id = '380aa5bf518edacb0e30e3b202da79b39a59d51ee48e4b41a5d00b0571bf4c28' 
  AND (
    token = 'jqGheIZF3/CP9vloMyhq28jQUFhY6TL55LXTqthUpw8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019