UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Amucu72sOPRt0sSY4xc/40GwqU+FZr0wgGY2/7pCn0o=' 
WHERE 
  key_id = 'ae64fa2461ace262cd8ef9a4dc3371015c16ae188ad1598b2f8f2bf4745bd4c4' 
  AND (
    token = 'Amucu72sOPRt0sSY4xc/40GwqU+FZr0wgGY2/7pCn0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026