UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cl+QFQfd9Ppfng6bOLupzxYtwHRv71Rv4tEZYhT30lY=' 
WHERE 
  key_id = 'fec289b5201849e321cbbdf1d05d217a99dd339cc51a609d0177979e3de6fbf8' 
  AND (
    token = 'Cl+QFQfd9Ppfng6bOLupzxYtwHRv71Rv4tEZYhT30lY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032