UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bdTxDVQ0N3h8B4HvInRKN3ZPZUgH8I0DzxVil2+yHKc=' 
WHERE 
  key_id = '1d1b6fe29360bd0949748d4e6119655ac5ec6a278e27e5cad36d7cc7a2fc2b9a' 
  AND (
    token = 'bdTxDVQ0N3h8B4HvInRKN3ZPZUgH8I0DzxVil2+yHKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025