UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U0/9ELM/MTzdhT3WIDq7XvEiSLzxdAjsAMjr7KqeXGU=' 
WHERE 
  key_id = 'e344bc69ad148ad78a129acc35f1aecac36a45d9135a4ce59226a9b5ed718970' 
  AND (
    token = 'U0/9ELM/MTzdhT3WIDq7XvEiSLzxdAjsAMjr7KqeXGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032