UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UDzXIDfaucjnlIyQSsm295FSPeAztKzO5GprOA4U26Y=' 
WHERE 
  key_id = '151c5ae6ba67582ded8d543cf2a8704c36ed12c19dc7ad2ff73692ac3c2ed7d9' 
  AND (
    token = 'UDzXIDfaucjnlIyQSsm295FSPeAztKzO5GprOA4U26Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029