UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cDHUJx2MsfTFYktYwUSZyw6kw23PShmrYQBDqjS+mqs=' 
WHERE 
  key_id = '9ef8bd150e82d397a80901485d0fbef7a29c0b8fafdca05b557e9284eda6037a' 
  AND (
    token = 'cDHUJx2MsfTFYktYwUSZyw6kw23PShmrYQBDqjS+mqs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043